{% include 'front/header.html' %}
<style type="text/css">
	.mui-input-group .mui-input-row {
		height: 1.466666rem !important;
		display: flex;
		align-items: center;
		flex-flow: row;
		margin-bottom: 0.133333rem;
		background: #fff;
	}
	
	.mui-input-group {
		background: none;
	}
	
	.mui-input-row input {
		text-align: right;
	}
	
	.mui-input-row:after {
		background: transparent !important;
	}
	
	.for-bottom {
		padding-top: 0.32rem;
		color: #999;
		padding: 0.32rem 0.426666rem;
		font-size: 0.346666rem;
	}
	
	.for-bottom .btn {
		background: #fee151;
		height: 1.333333rem;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #333333;
		border-radius: 0.213333rem;
		font-size: .5rem;
		margin-top: 1.173333rem;
	}
	
	.mui-input-row label {
		padding-left: 1.28rem;
		width: auto;
		margin-right: 1.28rem;
		font-size: 0.4rem;
	}
	
	.code {
		width: 2.666666rem !important;
	}
	
	.mui-input-row label~input,
	.mui-input-row label~select,
	.mui-input-row label~textarea {
		text-align: right;
		float: left;
		font-size: 0.373333rem;
		color: #666;
	}
	
	.info-con {
		width: 100%;
		height: 4.186666rem;
		background: url(/resource/front/images/forward/background.png);
		background-size: cover;
	}
	
	.get-time {
		width: 100%;
		text-align: center;
		font-size: 0.24rem;
		color: #fff;
	}
	
	.info-data {
		display: flex;
		flex-flow: column;
		padding-top: 0.613333rem;
		padding-left: 1.146666rem;
		padding-right: 1.146666rem;
	}
	
	.info-data .data-item {
		display: flex;
		flex-flow: row;
		justify-content: space-between;
		font-size: 0.32rem;
		color: #fff;
	}
	
	.progress {
		margin-top: 0.213333rem;
		/*background: rgba(0,0,0,.1);*/
		/*height: .13rem;*/
		/*margin-bottom: .14rem;*/
	}
</style>
<header class="mui-bar mui-bar-nav">
	<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	<h1 class="mui-title">添加银行卡</h1>
</header>
<div class="content">
	<div class="info-con">
		<div class="info-data">
			<p class="data-item">
				<span id="">发起申请</span>
				<span id="">银行处理中</span>
				<span id="">到账成功</span>
			</p>
			<div class="progress">
				<img src="/resource/front/images/forward/all.png" style="object-fit: cover; width: 100%; height: 100%;" />
				<!--<img src="/resource/front/images/forward/handle.png" />
				<img src="/resource/front/images/forward/apply.png" />-->
			</div>
		</div>
		<p class="get-time">5-7个工作日内到账</p>
	</div>
	<form class="mui-input-group">
		<div class="mui-input-row">
			<label>提现金额</label>
			<span id="money">
				<!--150元-->
			</span>
		</div>
		<div class="mui-input-row">
			<label>到账银行卡</label>
			<span id="cardName">
				<!--招商银行（2896）-->
			</span>
		</div>
	</form>

	<div class="for-bottom">
		<div class="btn">
			确定
		</div>
	</div>
</div>
{% include 'front/foot.html' %}
<script>
	mui.ready(function() {
		console.log(1)
		this.getTXinfo();   //获取提现详情
		this.handClick();  //点击完成
	})
	
	function handClick(){
		$('.btn').click(function(){
			var forwardTwo = ykp.getLocalStorage('forwardTwo');
			window.location.href = forwardTwo ? 'forwardTwo' : 'forward'+'?uid='+ykp.getLocalStorage('code')
		})
	}

	function getTXinfo() {
		var that = this;
		var img = ["/resource/front/images/forward/handle.png","/resource/front/images/forward/all.png"]
		ykp.doAjax({
			url: "/api/user/finance_detail",
			method: "post",
			data: {
				id: ykp.getUrlParam('id') || 1,
			},
			success: function(res) {
				$('#cardName').text(res.data.name);
				$('#money').text(res.data.withdraw_money);
//				$('.get-time').text("预计"+ that.getNowTime(res.data.create_time+res.data.yuji_apply_time,true)+"前到账");
				$('.progress img').attr('src',img[res.data.withdraw_status]);
				
			}
		})
	}
	
	function getNowTime(time, statu=false, str = '-') {
         if(time == "") {
             return "请传入时间";
         }
         var time = new Date(time * 1000);
         let month =  (time.getMonth() + 1) < 10 ? "0"+(time.getMonth() + 1) : (time.getMonth() + 1);
         let data =  time.getDate() < 10 ? "0"+(time.getDate()) : time.getDate();
         if(statu) {
            let getMilliseconds = time.getMilliseconds() < 10 ? "0"+(time.getMilliseconds()) : time.getMilliseconds();
            let getMinutes =  time.getMinutes() < 10 ? "0"+(time.getMinutes()) : time.getMinutes();
            let getHours =  time.getHours() < 10 ? "0"+(time.getHours()) : time.getHours();
            console.log(time.getFullYear())
             time = (time.getFullYear() + "-" + month + "-" + data + " " + getHours + ":" + getMinutes + ":" + getMilliseconds);
         } else {
         	console.log(time)
             time = (time.getFullYear() + str + month + str + data);
         }
         return time;
     }
//	defineClass('init', basejs, {
//		init: function() {
//			var it = this;
//			it.initGoodsInfo();
//		},
//		initGoodsInfo: function() {
//			$('.back').click(function() {
//				history.back(-1);
//			})
//		}
//	})
</script>